package com.rjwh.dingdong.client.view;

import android.app.AlertDialog;
import android.content.Context;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.rjwh.dingdong.client.R;

/**
 * 项目名称：whrjwh-parent
 * 类描述：
 * 创建人：wby
 * 创建时间：2016/8/2 10:18
 * 修改人：wby
 * 修改时间：2016/8/2 10:18
 * 修改备注：
 *
 */
public class PhotoDialog extends AlertDialog {


    private TextView photo_album_btn;
    private TextView camera_btn;

    public PhotoDialog(Context context) {
        super(context);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_person_data_head_img);
        getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
        photo_album_btn = (TextView) findViewById(R.id.dialog_person_data_head_img_photo_album_tv);
        camera_btn = (TextView) findViewById(R.id.dialog_person_data_head_img_camera_tv);
        photo_album_btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
                if (lsn != null)
                    lsn.onClick(0);
//

            }
        });

        camera_btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismiss();
                if (lsn != null)
                    lsn.onClick(1);
            }
        });

    }

    /**
     * 监听Dialog是否按下返回键 如果按下 就做相应处理
     *
     * @author deyi
     */
    public interface onBackLsn {
        void onClick(int type);
    }

    onBackLsn lsn;

    public void setBackLsn(onBackLsn lsn) {
        this.lsn = lsn;
    }


}
